package com.loser.module.base.mq;

import com.loser.utils.trace.MDCUtil;

public interface BaseMqConsumer {

    default void doWork(String traceId, Runnable runnable) {

        try {
            MDCUtil.setTraceId(traceId);
            runnable.run();
        } finally {
            MDCUtil.removeTraceId();
        }

    }

}
